<template>
	<view class="box">
		<view class="navigator" @click="lookUp(1)">
			<image src="@/static/img/monitor/tcm/tcmList.png"></image>
		</view>
		<view class="navigator" @click="lookUp(2)">
			<image src="@/static/img/monitor/tcm/accomplishment.png"></image>
		</view>
		<view class="stayTunedFor">敬请期待</view>
		<view class="other">
			<view class="item">生活方式评估</view>
			<view class="item">健康年龄评估</view>
			<view class="item">生命质量评估</view>
		</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				isConversion: '',
			}
		},
		methods:{
			lookUp(e) {
				if(e == 1) {
					this.$api.getIsConversion().then((res) => {
						if(res.data.returnCode == '200') {
							this.isConversion = res.data.result &&  res.data.result.isConversion;
							if(this.isConversion == true) {
								uni.showToast({
									title: '您还有问卷未评估，评估完之后再来添加吧',
									icon: 'none'
								})
							} else {
								uni.navigateTo({
									url:'/pages/monitor/tcm/addquestionnaire'
								})
							}
						}
						
					})
				}else {
					uni.navigateTo({
						url:'/pages/monitor/accomplishment/index'
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750upx;
		min-height: calc(100vh - 44px);
		background-color: #FFFFFF;
		.navigator {
			width: 702upx;
			margin: 73upx 24upx 62upx;
			height: 120upx;
			image {
				width: 100%;
				height: 100%;
			}
		}
		.navigator:nth-child(2) {
			margin: 48upx auto 58upx;
		}
		.stayTunedFor {
			position: relative;
			color: #333333;
			font-size: 26upx;
			text-align: center;
		}
		.stayTunedFor::before{
			content: '';
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			left: 24upx;
			display: block;
			width: 252upx;
			height: 2upx;
			background-color: #EBEBEB;
		}
		.stayTunedFor::after {
			content: '';
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			right: 24upx;
			display: block;
			width: 252upx;
			height: 2upx;
			background-color: #EBEBEB;
		}
		.other {
			margin: 49upx 24upx 0;
			width: 702upx;
			.item {
				width: 702upx;
				height: 90upx;
				background-color: #F1F1F1;
				border-radius: 45upx;
				line-height: 90upx;
				color: #333333;
				font-size: 28upx;
				text-align: center;
				margin-bottom: 30upx;
			}
		}
	}
</style>
